package com.willpower.eureka.controller;

import com.willpower.eureka.auth.response.Result;
import com.willpower.eureka.entity.SysMenu;
import com.willpower.eureka.service.ISysMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author wen-yi
 * @since 2021-11-05
 */
@RestController
@RequestMapping("/menus")
public class SysMenuController {
    @Autowired
    private ISysMenuService sysMenuService;

    @GetMapping
    public Result list(){
        List<SysMenu> menus = sysMenuService.getAllMenu();
        return Result.ok(menus);
    }

}
